package com.ruoyi.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.domain.vo.TestView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.T22Mapper;
import com.ruoyi.domain.T22;
import com.ruoyi.service.IT22Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 111111Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-05
 */
@Service
public class T22ServiceImpl implements IT22Service
{
    @Autowired
    private T22Mapper t22Mapper;
    @Autowired
    private T22ServiceImpl t22Service;

    /**
     * 查询111111
     *
     * @param ID 111111主键
     * @return 111111
     */
    @Override
    public T22 selectT22ByID(Long ID)
    {
        return t22Mapper.selectT22ByID(ID);
    }

    /**
     * 查询111111列表
     *
     * @param t22 111111
     * @return 111111
     */
    @Override
    public List<T22> selectT22List(T22 t22)
    {
        PageUtils.startPage();
        return t22Mapper.selectT22List(t22);
    }

    /**
     * 新增111111
     *
     * @param t22 111111
     * @return 结果
     */
    @Override
    @Transactional(propagation = Propagation.NEVER)
    public int insertT22(T22 t22)
    {
        int i = t22Mapper.insertT22(t22);
        return i;
    }

    /**
     * 修改111111
     *
     * @param t22 111111
     * @return 结果
     */
    @Override
    public int updateT22(T22 t22)
    {
        return t22Mapper.updateT22(t22);
    }

    /**
     * 批量删除111111
     *
     * @param IDs 需要删除的111111主键
     * @return 结果
     */
    @Override
    public int deleteT22ByIDs(Long[] IDs)
    {
        return t22Mapper.deleteT22ByIDs(IDs);
    }

    /**
     * 删除111111信息
     *
     * @param ID 111111主键
     * @return 结果
     */
    @Override
    public int deleteT22ByID(Long ID)
    {
        return t22Mapper.deleteT22ByID(ID);
    }

    @Override
    public List<T22> findAll() {
        return t22Mapper.findAll();
    }

    @Override
    public List<T22> findAllByF0301(Long f0301) {
        return t22Mapper.findAllByF0301(f0301);
    }

    @Override
    @Transactional
    public List<TestView> findAllByView() {
        T22 t22 = t22Mapper.selectT22ByID(1L);
        T22 t22demo = new T22();
        BeanUtils.copyProperties(t22,t22demo);
        t22demo.setId(5L);
        t22.setRemarks("123456789");
//        t22Mapper.updateT22(t22);
        t22Service.insertT22(t22demo);
        return new ArrayList<>();
    }
}
